package com.yuanrui.subject.common.enums;

import lombok.Getter;

/**
 * 题目类型枚举
 * 
 * @author: ChickenWing
 * @date: 2023/10/3
 */
@Getter
public enum SubjectInfoTypeEnum {

        /**
        * 单选
        */
        RADIO(1, "单选"),
        /**
        * 多选
        */
        MULTIPLE(2, "多选"),
        /**
        * 判断
        */
        JUDGE(3, "判断"),
        /**
        * 简答
        */
        BRIEF(4, "简答");

        private final Integer code;

        private final String desc;

        SubjectInfoTypeEnum(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static SubjectInfoTypeEnum getByCode(Integer code) {
            for (SubjectInfoTypeEnum value : values()) {
                if (value.code.equals(code)) {
                    return value;
                }
            }
            return null;
        }

}
